class UpdateValleyersAddFieldAlbumsCount < ActiveRecord::Migration
  def self.up
    add_column :valleyers, :albums_count, :integer, :default => 0
    Valleyer.all.each do |valleyer|
      valleyer.albums_count = valleyer.albums.size
      valleyer.save!
    end if Rails.env != 'test'
  end

  def self.down
  end
end
